#include "stdafx.h"
#include "global.h"
#include "LockCS.h"
int g_usercount=0;
static CLockCS g_iplock;
BOOL GetNewVirtualIP(char *pipstr)
{
	g_iplock.Lock();
	g_usercount++;
	if(g_usercount%255==0)
		g_usercount++;
	if(g_usercount<255*255*255)
	{
		sprintf(pipstr,"10.%d.%d.%d",g_usercount/(255*255),g_usercount/255,g_usercount%255);
		//sprintf(pipstr,"10.81.65.%d",g_usercount%255);
	}
	else
		return FALSE;
	g_iplock.Unlock();
	return TRUE;
}